package work.display
{
	/**
	 * @author 张峰
	 * @QQ 37520626
	 * @Email 7677@163.com
	 * @Date 2012-12-19 下午7:43:31
	 */
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import zf.display.FlashMovieClipComponent;
	
	public class FlvMovieClip extends FlashMovieClipComponent
	{
		public function FlvMovieClip()
		{
			super();
		}
		override protected function addStage():void
		{
			this.addFrameScript(this.totalFrames-1,onEndFrameAS);
			var bg:Sprite=new Sprite();
			bg.graphics.beginFill(0,0);
			bg.graphics.drawRect(0,0,width,height);
			bg.graphics.endFill();
			bg.addEventListener(MouseEvent.CLICK,onClickThisHandler);
			this.addChild(bg);
		}
		private function onEndFrameAS():void
		{
			stop();
			endFrameAS();
		}
		/**
		 * 最后一帧执行代码 
		 * 
		 */
		protected function endFrameAS():void
		{
			
		}
		/**
		 * 点击视频背景,默认停止并调用 endFrameAS
		 * 
		 */
		protected function clickMovieBg():void
		{
			onEndFrameAS();
		}
		private function onClickThisHandler(e:MouseEvent):void
		{
			clickMovieBg();
		}
	}
}